package com.qst.mapreduce.wordcount.diliuzhang.diyijie;

import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class DoubleMapper extends Mapper<LongWritable, Text, Text, DoubleWritable> {
    @Override
    protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, Text, DoubleWritable>.Context context) throws IOException, InterruptedException {
        String line=value.toString();
        String[] words=line.split(",");
        Double mintemp=Double.parseDouble(words[1]);
        Text outkey=new Text("avg");
        DoubleWritable outValue=new DoubleWritable(mintemp);
        context.write(outkey, outValue);



    }
}
